home *** CD-ROM | disk | FTP | other *** search
- From: WEBPO@harbinger.net
- Subject: [EDI WebPO for $CompanyName$]
-
- $outvar(devnull)
- <!--------------------------------------------------------------------
- po/edi.infile - Blend infile used to produce the edi 850 mail file
- which is used to interface between WebPO and
- email.
-
- 1996-09-25 RKJ-000 Original version
- -->
- $endout
- ----BEGIN EDI----
- $outfile("/dev/null")
- $set(xphone,$infile("regexp.blendmac",$phone,"[-\.() ]","\0"))
- $set(xinstructions,$infile("regexp.blendmac",$instructions,"\n","\0"))
- $set(yymmdd,$cdate(0,"%y%m%d"))
- $set(hhmm,$cdate(0,"%H%M"))
- $set(segmentCount,5)
- $endout$ISA*00*0000000000*00*0000000000*12*$fmt("%15.15s","$xphone ","string")*ZZ*$fmt("%15.15s","$SellerID ","string")*$yymmdd$*$hhmm$*00300*U*000000001*0*P*:
- GS*PO*$fmt("%.12s",$xphone,"string")*$fmt("%.12s",$SellerID,"string")*$yymmdd$*$hhmm$*1*X*003010HNS
- ST*850*0001
- BEG*00*SA*$poNumber$*$yymmdd$
- $if($CuName)$if($CustomerID)N1*BY*$CuName$*91*$CustomerID$$inc(segmentCount)$else$N1*BY*$CuName$$inc(segmentCount)$endif$$endif
- $if($address1)N3*$address1$$if($address2)*$address2$$endif$$inc(segmentCount)$endif
- N4*$City$*$State$*$zip$*$country$
- $if($and($Contact,$email))PER*IC*$Contact$*EM*$email$$inc(segmentCount)$endif$PER*IC**TE*$phone$$if($instructions)NTE*GEN*$xinstructions$$inc(segmentCount)$endif
- $outfile("/dev/null")
- $set(loop,0)
- $set(bigTotal,0)
- $set(itemCount,1)
- $while($not($equal($ProductCount,$loop)))
- $if($var(ItemUnits$loop$))
- $set(aVal,$var(ItemUnits$loop$))
- $else
- $set(aVal,0)
- $endif
- $if($gt($aVal,0))
- $set(aTotal,$mult($aVal,$var(ItemCost$loop$)))
- $outvar(lineitem$itemCount$)PO1*$itemCount$*$aVal$*EA*$var(ItemCost$loop$)***VN*$var(ItemCode$loop$)
- $endout
- $inc(itemCount)
- $set(bigTotal,$add($aTotal,$bigTotal))
- $endif
- $inc(loop)
- $endwhile
- $endout$$set(loop,0)$while($not($equal($itemCount,$loop)))$var(lineitem$loop$)$inc(loop)$endwhile$CTT*$fmt("%.d",$minus($itemCount,1),"int")
- SE*$fmt("%.d",$add($itemCount,$segmentCount),"int")*0001
- GE*1*1
- IEA*1*000000001
- ----END EDI----